package org.redisson;

import org.redisson.service.HelloWordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * Created by MD on 2017/8/25.
 */
@SpringBootApplication()
//@ImportResource(locations = {"classpath:application-redisson.xml"})
public class Application {
    private static Logger logger = LoggerFactory.getLogger(Application.class);

    @Autowired
    private HelloWordService helloWordService;

    @ResponseBody
    @RequestMapping("/")
    public String helloWord() {
        logger.debug("time:[{}],servicePoint:[point-1]", new Date().getTime());
        helloWordService.say();
        return String.format("time:[{%s}],servicePoint:[point-1]", new Date().getTime());
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
